/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.type;

/**
 * 
 * @author haolw
 * @time 2017/08/25
 */
public enum PayType {
	ALIPAY(1, "支付宝支付"), WXPAY(2, "微信支付");
	private Integer type;
	private String name;

	PayType(Integer type, String name) {
		this.type = type;
		this.name = name;
	}

	public static boolean validate(Integer type) {
		for (PayType payType : PayType.values()) {
			if (payType.getType().equals(type)) {
				return true;
			}
		}
		return false;
	}

	public static String getNameByType(Integer type) {
		for (PayType payType : PayType.values()) {
			if (payType.getType().equals(type)) {
				return payType.getName();
			}
		}
		return "";
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
